{% extends "base.html" %}

{% block title %}转账{% endblock %}

{% block content %}
<div class="transfer-container">
    <div class="card">
        <div class="card-header">
            <h4>转账操作</h4>
        </div>
        <div class="card-body">
            <form method="POST">
                <div class="mb-3">
                    <label for="from_card" class="form-label">转出银行卡</label>
                    <select class="form-select" id="from_card" name="from_card" required>
                        {% for card in cards %}
                        <option value="{{ card.cardID }}">{{ card.cardID }} ({{ card.savingName }}) - 余额: ¥{{ "%.2f"|format(card.balance) }}</option>
                        {% endfor %}
                    </select>
                </div>
                <div class="mb-3">
                    <label for="to_card" class="form-label">转入银行卡号</label>
                    <input type="text" class="form-control" id="to_card" name="to_card" required>
                </div>
                <div class="mb-3">
                    <label for="amount" class="form-label">转账金额</label>
                    <input type="number" step="0.01" min="0.01" class="form-control" id="amount" name="amount" required>
                </div>
                <div class="mb-3">
                    <label for="password" class="form-label">转出卡密码</label>
                    <input type="password" class="form-control" id="password" name="password" required>
                </div>
                <div class="mb-3">
                    <label for="remark" class="form-label">备注(可选)</label>
                    <input type="text" class="form-control" id="remark" name="remark">
                </div>
                <button type="submit" class="btn btn-primary">
                    <i class="bi bi-arrow-left-right"></i> 确认转账
                </button>
            </form>
        </div>
    </div>
</div>
{% endblock %}